
import { ModalForm, ProFormDigit, ProFormRadio, ProFormText } from '@ant-design/pro-components';
import { Form } from 'antd';

export default function MissionsOrderDialog({children, onFinish, default_record_events_file, title}) {
  const [form] = Form.useForm();
  return (
    <ModalForm
      title={title || "盟约任务"}
      trigger={children}
      form={form}
      autoFocusFirstInput
      modalProps={{
        destroyOnClose: true,
      }}
      submitTimeout={2000}
      onFinish={values => {
        onFinish(values)
        return true
      }}
    >
      <ProFormDigit
        name="start_idx"
        label="start_idx"
        initialValue={0}
      />

      <ProFormDigit
        name="limit"
        label="limit"
        initialValue={0}
      />
      <ProFormRadio.Group
        name="reset_keyboard"
        label="重置按键"
        initialValue={0}
        options={[
          {label: '是', value: 1},
          {label: '否', value: 0},
        ]}
      />
      <ProFormRadio.Group
        name="auto_run_record_events"
        label="按键播放"
        hidden
        initialValue={1}
        options={[
          {label: '是', value: 1},
          {label: '否', value: 0},
        ]}
      />
      <ProFormRadio.Group
        name="auto_mission_order"
        label="盟约收菜"
        initialValue={0}
        options={[
          {label: '是', value: 1},
          {label: '否', value: 0},
        ]}
      />
      <ProFormText label="录制文件" name="record_events_file" initialValue={default_record_events_file || "f1_abs_1753415202.json"} placeholder={"录制文件"} />
    </ModalForm>
  )
}